﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using foursquare.Foursquare;

namespace foursquare.Forms
{
    public partial class AddVenueView : Form
    {
        public AddVenueView()
        {
            InitializeComponent();

            List<City> cities = FS.GetCities();
            cmbCities.DataSource = cities;
            cmbCities.DisplayMember = "name";
            cmbCities.ValueMember = "id";
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            Venue v = FS.AddVenue(txtName.Text,
                txtAddress.Text,
                txtCrossStreet.Text,
                txtCity.Text,
                txtState.Text,
                txtZip.Text,
                Convert.ToInt32(cmbCities.SelectedValue),
                txtPhone.Text);

            Close();
        }
    }
}